package com.tianji.promotion.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.promotion.domain.query.CodeQuery;
import com.tianji.promotion.service.IExchangeCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 兑换码 前端控制器
 * </p>
 *
 * @author huanghui
 * @since 2023-08-02
 */
@RequiredArgsConstructor
@RestController
@Api(tags = "优惠券相关接口")
@RequestMapping("/codes")
public class ExchangeCodeController {
    private final IExchangeCodeService codeService;

    /** @author ZXX-挚爱
    * @Description 分页查询兑换码
    * @Dete 20:28 2023/8/2
    * @Param [query]
    * @return com.tianji.common.domain.dto.PageDTO<java.lang.String>
    **/

    @ApiOperation("分页查询兑换码")
    @GetMapping("/page")
    public PageDTO<String> queryCodePage(@Valid
                                         CodeQuery query){
        return codeService.queryCodePage(query);
    }
}
